﻿using System;
using System.Web.UI;

namespace Thksoft.Module.DataDetail.Master
{
    public partial class Capital : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //自动切换都1
                Check = true;
            }
        }

        /// <summary>
        /// 切换选项卡
        /// </summary>
        public bool Check
        {
            get
            {
                if (FORM_TAB1.Style["display"] == null || FORM_TAB1.Style["display"] == "none")
                {
                    return false;
                }
                return true;
            }
            set
            {
                if (value)
                {
                    if (FORM_TAB1.Style["display"] == null || FORM_TAB1.Style["display"] == "none")
                    {
                        FORM_TAB1.Style["display"] = "block";
                        FORM_TAB2.Style["display"] = "none";
                    }
                }
                else
                {
                    if (FORM_TAB1.Style["display"] == null || FORM_TAB1.Style["display"] == "block")
                    {
                        FORM_TAB1.Style["display"] = "none";
                        FORM_TAB2.Style["display"] = "block";
                    }
                }
            }
        }

        /// <summary>
        /// 切换选项卡事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void FORM_CHECK_CLICK(object sender, EventArgs e)
        {
            if (Check)
            {
                Check = false;
            }
            else
            {
                Check = true;
            }
        }

        /// <summary>
        /// 选项卡1
        /// </summary>
        public Control Table1
        {
            get
            {
                return FORM_TAB1;
            }
        }

        /// <summary>
        /// 选项卡2
        /// </summary>
        public Control Table2
        {
            get
            {
                return FORM_TAB2;
            }
        }

        /// <summary>
        /// 设置标题
        /// </summary>
        public string CTitle
        {
            get
            {
                return Title.InnerHtml;
            }
            set
            {
                Title.InnerHtml = value;
            }
        }
    }
}